#include "main.h"
#include "FreeRTOS.h"
#include "task.h"
// #include "printf.h"
extern void NVIC_Init();

void task0(void *arg)
{
	(void)arg;
	while (1)
	{
		printf_("task0 run.\r\n");
		vTaskDelay(1000);
	}
}

void task1(void *arg)
{
	(void)arg;
	while (1)
	{
		printf_("task1 run.\r\n");
		vTaskDelay(600);
	}
}

void freertos_init()
{
	NVIC_Init();
	TaskHandle_t Task0_handle, Task1_handle;

	xTaskCreate(task0, "task0", 1024, NULL, 1, &Task0_handle);
	xTaskCreate(task1, "task1", 1024, NULL, 2, &Task1_handle);
	// printf("vTaskStartScheduler\r\n");
	vTaskStartScheduler();
	while (1)
	{
	}
}
